<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../inc/taglibs.jsp" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <meta name="format-detection" content="telephone=no">
    <meta charset="UTF-8">
    <meta name="description" content="Violate Responsive Admin Template">
    <meta name="keywords" content="Super Admin, Admin, Template, Bootstrap">
    <title>Super Admin Responsive Template</title>
    <!-- CSS -->
    <%@ include file="../inc/new/css.jsp" %>
</head>
<body id="skin-cloth">
<%@ include file="../inc/new/header.jsp" %>
<div class="clearfix"></div>
<section id="main" class="p-relative" role="main">
    <input type="hidden" id="mian_module" value="统计管理">
    <input type="hidden" id="child_module" value="资源统计列表">
    <%@ include file="../inc/new/menu.jsp" %>
    <section id="content" class="container">
        <input type="hidden" id="resourceId" value="${welfare.id}">
        <div class="block-area" id="search">
            <p style="font-size: larger">福利名称：${welfare.title}</p>
            <div class="row">
                <div class="col-md-2 form-group">
                    <label>开始日期：</label>
                    <input type="text" class="form-control input-append date form_datetime" readonly value="${createDate}" id="startDate" data-rule="required" placeholder="..."/>
                </div>
                <div class="col-md-2 form-group">
                    <label>结束日期：</label>
                    <input type="text" class="form-control input-append date form_datetime" readonly value="${createDate}" id="endDate" data-rule="required" placeholder="..."/>
                </div>
            </div>
        </div>
        <div class="block-area" id="alternative-buttons">
            <button id="c_search" class="btn btn-alt m-r-5">查询</button>
            <button class="btn btn-alt m-r-5" onclick="goBack()">返回</button>
        </div>
        <hr class="whiter m-t-20"/>
        <!-- form表格 -->
        <div class="block-area" id="tableHover">
            <table class="table table-bordered table-hover tile" id="dataTables" cellspacing="0" width="100%">
                <thead>
                <tr>
                    <th>日期</th>
                    <th>浏览量</th>
                </tr>
                </thead>
            </table>
        </div>
    </section>
    <br/><br/>
</section>
<!-- JS -->
<%@ include file="../inc/new/foot.jsp" %>

<script>
    comment = {
        v: {
            list: [],
            dTable: null
        },
        fn: {
            init: function () {
                comment.fn.dataTableInit();

                $("#c_search").click(function () {
                    comment.v.dTable.ajax.reload();
                });
            },
            dataTableInit: function () {
                comment.v.dTable = $leoman.dataTable($('#dataTables'), {
                    "processing": true,
                    "serverSide": true,
                    "searching": false,
                    "ajax": {
                        "url": "${contextPath}/admin/statData/welfare/list",
                        "type": "POST"
                    },
                    "columns": [
                        {"data": "createDate"},
                        {"data": "playNum"}
                    ],
                    "fnServerParams": function (aoData) {
                        aoData.welfareId = $("#resourceId").val();
                        aoData.startDate = $("#startDate").val();
                        aoData.endDate = $("#endDate").val();
                    }
                });
            }
        }
    }
    $(function () {
        comment.fn.init();
    })
</script>
<script>
    function goBack() {
        window.location.href = '${contextPath}/admin/statData/resource/index?type=4';
    }
</script>
</body>
</html>

